<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('用户信息列表')" />
</head>
<body class="gray-bg">
<!--<input name="dataType"  type="hidden" th:value="${dataType}"/>-->
<input id="userNo" type="hidden"/>
<input id="userName" type="hidden"/>
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <label>用户昵称：</label>
                            <input type="text" name="userName"/>
                        </li>
                        <li>
                            <label>手机号码：</label>
                            <input type="text" name="phonenumber"/>
                        </li>
                        <li>
                            <label>员工编号：</label>
                            <input type="text" name="userNo"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
    var prefix = ctx + "system/user";
    var dataType = [[${dataType}]];
    $(function () {
        var options = {
            url: prefix + "/listUser?dataType=" + dataType,
            modalName: "销售员列表",
            clickToSelect: true,
            onClickRow:onClickRow,
            columns: [{
                radio: true
            },
                {
                    field: 'userId',
                    title: '用户ID',
                    visible: false
                },
                {
                    field: 'userNo',
                    title: '员工编号'
                },
                {
                    field: 'avatar',
                    title: '头像路径'
                },
                {
                    field: 'sex',
                    title: '用户性别'
                },
                {
                    field: 'userName',
                    title: '用户昵称'
                },
                {
                    field: 'phonenumber',
                    title: '手机号码'
                },
                {
                    field: 'email',
                    title: '用户邮箱'
                }]
        };
        $.table.init(options);
    });

    function onClickRow(row, $element) {
        $("#userNo").val(row.userNo);
        $("#userName").val(row.userName);
    }
</script>
</body>
</html>